import Vue from 'vue'
import VueRouter from 'vue-router'
import Herolist from "../components/herolist.vue"
import Skill from "../components/skill.vue"
import Package from "../components/package.vue"
import Heroadd from "../components/heroadd.vue"
import Heroedit from "../components/heroedit.vue"


Vue.use(VueRouter)

//设置路径和对应的路由关系
const routes = [
    {
        path: '/',
        redirect: "/herolist"
    },
    {
        path: '/herolist',
        component: Herolist
    },
    {
        path: '/skill',
        component: Skill
    },
    {
        path: '/package',
        component: Package
    },
    {
        path: '/heroadd',
        component: Heroadd
    },
    {
        path: '/heroedit',
        component: Heroedit
    }
]

//实例化一个router出来
const router = new VueRouter({
    routes
})

//将实例挂载到vue中
export default router